{extend name="layout/common_layout" /}
{block name="body"}
<!--tab标签-->
<div class="layui-tab layui-tab-brief">
    <ul class="layui-tab-title">
        <li class="layui-this">源码管理</li>
    </ul>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <form class="layui-form layui-form-pane" action="{:url('admin/sourcecode/index')}" method="get">
                <div class="layui-inline">
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-block cids">
                        <select name="status" lay-verify="required">
                            <option value="0">全部</option>
                            <option value="1"  {if condition="$status==1"} selected="selected"{/if}>未发布</option>
                            <option value="2"  {if condition="$status==2"} selected="selected"{/if}>审核中</option>
                            <option value="3"  {if condition="$status==3"} selected="selected"{/if}>审核通过</option>
                            <option value="3"  {if condition="$status==4"} selected="selected"{/if}>审核不通过</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn">搜索</button>
                </div>

            </form>
            <hr>

            <table class="layui-table">
                <thead>
                <tr>
                    <th style="width: 30px;">ID</th>
                    <th>用户</th>
                    <th>标题</th>
                    <th>姓名</th>
                    <th>邮箱</th>
                    <th>电话</th>
                    <th>置顶</th>
                    <th>状态</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {foreach name="list" item="vo"}
                <tr>
                    <td>{$vo.sc_id}</td>
                    <td>{$vo.u_nickname}</td>
                    <td>{$vo.sc_title}</td>
                    <td>{$vo.sc_name}</td>
                    <td>{$vo.sc_email}</td>
                    <td>{$vo.sc_phone}</td>
                    {if condition="$vo.sc_is_top == 1"}
                        <td style="color: red">不置顶</td>
                    {else/}
                        <td style="color: #0BB20C">置顶</td>
                    {/if}
                    {if condition="$vo.sc_status == 1"}
                        <td style="color: #0C0C0C">未发布</td>
                    {/if}
                    {if condition="$vo.sc_status == 2"}
                        <td style="color: #0C0C0C">审核中</td>
                    {/if}
                    {if condition="$vo.sc_status == 3"}
                        <td style="color: green">审核通过</td>
                    {/if}
                    {if condition="$vo.sc_status == 4"}
                        <td style="color: red">审核不通过</td>
                    {/if}
                    <td>{$vo.sc_create_time|date="Y-m-d H:i:s",###}</td>
                    <td>
                        {if condition="$vo.sc_status == 2"}
                            <a href="{:url('admin/sourcecode/edit',['id'=>$vo['sc_id'], 'status' => $vo['sc_status'], 'res' =>3, 'uid' => $vo['sc_uid'], 'sctitle' => $vo['sc_title']])}" class="layui-btn layui-btn-danger layui-btn-mini ajax-confim">通过</a>
                            <a href="{:url('admin/sourcecode/edit',['id'=>$vo['sc_id'], 'status' => $vo['sc_status'], 'res' =>4, 'uid' => $vo['sc_uid'], 'sctitle' => $vo['sc_title']])}" class="layui-btn layui-btn-danger layui-btn-mini ajax-confim">不通过</a>
                        {/if}
                        {if condition="$vo.sc_status == 4"}
                            <a href="{:url('admin/sourcecode/edit',['id'=>$vo['sc_id'], 'status' => $vo['sc_status'], 'res' =>3, 'uid' => $vo['sc_uid'], 'sctitle' => $vo['sc_title']])}" class="layui-btn layui-btn-danger layui-btn-mini ajax-confim">通过</a>
                        {/if}
                            <a href="{:url('admin/sourcecode/detail',['id'=>$vo['sc_id']])}" class="layui-btn layui-btn-normal layui-btn-mini">详情</a>
                    </td>
                </tr>
                {/foreach}
                </tbody>
            </table>
            <!--分页-->
            {$list->render()}
        </div>
    </div>
</div>
{/block}